Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add usage snippets for Google Health AI models #1084

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

ndebuhr
Copy link
Contributor

@ndebuhr ndebuhr commented Dec 24, 2024

Adding usage snippets to improve Hugging Face Hub model pages for CXR Foundation and Derm Foundation - improving usability via example Python code and linked Jupyter notebooks. Doing this at the model library level, to complement the usage documentation in the model cards, so that the "Use this model" Hub button provides useful information (currently "integration status unknown").

Copy link
Member

@Vaibhavs10 Vaibhavs10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @ndebuhr - re: both snippets:

  1. Both should actually be snippets (we discourage putting URLs to notebooks etc)
  2. For the other code snippet, we try to put the least possible lines of code that someone can understand/ work with. So would be great to reduce it.

Otherwise, I think I think this information can be nicely fit in the Model Card.

@ndebuhr
Copy link
Contributor Author

ndebuhr commented Jan 2, 2025

@Vaibhavs10 I can collapse some lines or remove some comments to further reduce the LOC, but I think that would impact readability (especially in the relatively low-width snippet modal). Hoping this second pass is better?

@ndebuhr ndebuhr requested a review from Vaibhavs10 January 2, 2025 23:29
Copy link
Member

@Vaibhavs10 Vaibhavs10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for iterating here, some last nits and we're good to merge!

@@ -95,6 +95,26 @@ export const bm25s = (model: ModelData): string[] => [
retriever = BM25HF.load_from_hub("${model.id}")`,
];

export const cxr_foundation = (model: ModelData): string[] => [
`# Install library
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove the install instructions completely from here and keep them in the model card (As they are currently and just start from from PIL import Image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we aren't doing a "typical" installation (e.g., pip install from PyPI or git), I'm a bit concerned about pulling that information out of the snippet. I think people will make assumptions that aren't true. Basically, there's no way somebody is going to correctly use the library or guess the installation without this, so I'd really prefer we keep that critical information in the snippet (as it looks like some other libraries have done). Is that fair?

packages/tasks/src/model-libraries-snippets.ts Outdated Show resolved Hide resolved
packages/tasks/src/model-libraries-snippets.ts Outdated Show resolved Hide resolved
packages/tasks/src/model-libraries-snippets.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants